package cn.tedu.thread;

import org.junit.Test;

/*本类用于测试多线程编程方式一*/
public class TestThread1 {
    public static void main(String[] args) {
        MyThread myThread = new MyThread();
        MyThread myThread1 = new MyThread();
        myThread.setName("老铁线程");
        myThread1.setName("线程二");

        myThread.start();
        myThread1.start();
    }

    @Test
    public void test() {
        MyThread myThread = new MyThread();
        MyThread myThread1 = new MyThread();


        myThread.start();
        myThread1.start();
    }
}

class MyThread extends Thread {
    public MyThread() {
    }

    public MyThread(String name) {
        super(name);
    }

    @Override
    public void run() {
        for (int i = 0; i < 99; i++) {
            System.out.println(getName());

        }

    }

}
